﻿using SmartHotel.Localization;
using Volo.Abp.AuditLogging;
using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;

namespace SmartHotel;

[DependsOn(
    typeof(AbpAuditLoggingDomainSharedModule)
    )]
public class SmartHotelDomainSharedModule : AbpModule
{
    public override void PreConfigureServices(ServiceConfigurationContext context)
    {
        SmartHotelGlobalFeatureConfigurator.Configure();
        SmartHotelModuleExtensionConfigurator.Configure();
    }

    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        Configure<AbpVirtualFileSystemOptions>(options =>
        {
            options.FileSets.AddEmbedded<SmartHotelDomainSharedModule>();
        });

        Configure<AbpLocalizationOptions>(options =>
        {
            options.Resources
                .Add<SmartHotelResource>("en")
               // .AddBaseTypes(typeof(AbpValidationResource))
                .AddVirtualJson("/Localization/SmartHotel");

            options.DefaultResourceType = typeof(SmartHotelResource);
        });

        Configure<AbpExceptionLocalizationOptions>(options =>
        {
            options.MapCodeNamespace("SmartHotel", typeof(SmartHotelResource));
        });
    }
}
